Each Application operated by the ANDROID operating system is composed of multiple Activities. An Activity is a software component within an Application operated by the ANDROID operating system. An Activity is capable of interacting with the user and also to invoke other components, which are either a part of the same application or a part of a different application which is installed on the same appliance operating the ANDROID operating system.
When an Activity of the ANDROID operating system would like to ask the ANDROID Operation System to locate and launch an Application that can perform a specific operation, it sends an Intent.
An Intent is an abstract object, which is used to describe an operation to be performed. The Intent object contains a “Activity Action”, which is a string selected from a fixed set of action types that may be pre-defined by the operating system, such as ACTION_VIEW, ACTION_EDIT, ACTION_MAIN. The Intent also contains a data, which is passed to the Selected Application.
For example, when a user selects the “send feedback” button on a specific Activity in a specific application, the Activity might ask the operating system to invoke another Activity that can handle an ACTION_SEND Intent. This is usually done by calling the startActivity method of Activity class. An example of such code is now provided:
startActivity(new Intent(IntentACTION_SEND));
The Operating System is responsible for launching the email application, which in turn will handle the flow of sending email and then will return the user back to source applicationlication.
As mentioned above, the Intent may also carry data. In our example, the data may contain the body of the email.
In addition to the default Activities, the Operating System also allows other Activities to register themselves as capable of handling Intents as well. For example, when an application is installed, it registers all the types of Actions (“Intents”) that each of its Activities can handle. For example, an email application will register itself as capable of handling an ACTION_SEND Intent.
When an Activity queries the operating system to find another Activity which can handle ACTION_SEND intent, the Operating System might find more than one match, i.e. more than one Activity may be registered as capable of handling the queried Intent, possibly in more than one application, that can handle this Intent. In that case, the Operation System will perform an Intent Mapping process. The purpose of an Intent Mapping process is to select the most fitting application to handle the Intent. Typically, a user interface is displayed which allows the user to select which application, amongst all appllications that are registered as capable of handling this intent, will handle the Intent. This interface is referred to as the “Intent Menu”.